load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "logs",
    srcs = ["logs.go"],
    importpath = "github.com/pachyderm/pachyderm/v2/src/server/logs",
    visibility = ["//visibility:public"],
    deps = [
        "//src/auth",
        "//src/internal/errors",
        "//src/internal/log",
        "//src/internal/lokiutil",
        "//src/internal/lokiutil/client",
        "//src/internal/protoutil",
        "//src/logs",
        "//src/pfs",
        "//src/pps",
        "//src/server/auth",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//types/known/structpb",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "logs_test",
    srcs = [
        "internal_test.go",
        "logs_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":logs"],
    shard_count = 3,
    deps = [
        "//src/internal/errors",
        "//src/internal/log",
        "//src/internal/lokiutil",
        "//src/internal/lokiutil/client",
        "//src/internal/lokiutil/testloki",
        "//src/internal/pctx",
        "//src/internal/require",
        "//src/internal/uuid",
        "//src/logs",
        "//src/pps",
        "@com_github_google_go_cmp//cmp",
        "@com_github_google_go_cmp//cmp/cmpopts",
        "@com_github_itchyny_gojq//:gojq",
        "@org_golang_google_protobuf//encoding/protojson",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//testing/protocmp",
        "@org_golang_google_protobuf//types/known/structpb",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_uber_go_zap//:zap",
    ],
)
